import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    ActionsShow: false, // 首页文章反馈面板是否显示的变量
    actionArtId: '', // 点击关闭的当前文章id
    firstActions: [ // 一级反馈面板显示内容
      { name: '不感兴趣' },
      { name: '反馈垃圾内容' }
    ],
    secondActions: [ // 二级反馈面板显示内容
      {
        value: 0,
        name: '其它问题'
      },
      {
        value: 1,
        name: '标题夸张'
      },
      {
        value: 2,
        name: '低俗色情'
      },
      {
        value: 3,
        name: '错别字多'
      },
      {
        value: 4,
        name: '旧闻重复'
      },
      {
        value: 6,
        name: '内容不实'
      },
      {
        value: 8,
        name: '侵权'
      },
      {
        value: 5,
        name: '广告软文'
      },
      {
        value: 7,
        name: '涉嫌违法犯罪'
      }
    ],
    headerImgUrl: '', // 用户头像
    userName: ''

  },
  mutations: {
    //  更改反馈面板的显示状态
    ActionsShowMutation (state, bool) {
      state.ActionsShow = bool
    },
    // 设置反馈面板当前的文章id
    setActionIdMutation (state, artId) {
      state.actionArtId = artId
    },
    setHeaderImgUrlMutation (state, url) {
      state.headerImgUrl = url
    },
    setUserNameMutation (state, url) {
      state.userName = url
    }

  },
  actions: {
  },
  modules: {
  }
})
